package com.huidz.calendar.util;

import android.app.Activity;
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.graphics.Color;
import android.location.Address;
import android.location.Geocoder;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.provider.CalendarContract;
import android.text.format.Time;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.PopupWindow;
import android.widget.TextView;
import android.widget.Toast;

import com.bumptech.glide.Glide;
import com.google.gson.Gson;
import com.haibin.calendarview.Calendar;
import com.huidz.calendar.R;
import com.huidz.calendar.model.AlmanacModel;
import com.umeng.socialize.ShareAction;
import com.umeng.socialize.bean.SHARE_MEDIA;
import com.umeng.socialize.media.UMImage;
import com.umeng.socialize.media.UMWeb;

import org.json.JSONObject;

import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;

import okhttp3.Call;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;


public class Apiutils {

    /********************版本2.2以后的url/*************************/
    public static String CALENDER_URL = "content://com.android.calendar/calendars";
    public static String CALENDER_EVENT_URL = "content://com.android.calendar/events";
    public static String CALENDER_REMINDER_URL = "content://com.android.calendar/reminders";

    public static String CALENDARS_NAME = "boohee";
    public static String CALENDARS_ACCOUNT_NAME = "BOOHEE@boohee.com";
    public static String CALENDARS_ACCOUNT_TYPE = "com.android.boohee";
    public static String CALENDARS_DISPLAY_NAME = "BOOHEE账户";

    public static boolean isNetworkConnecteds;
    public static String DB_NAME = "saa.db";
    public static String DB_LOCTION = "";

    public static String GET_ALMANACURL = "http://api.tianapi.com/txapi/lunar/index?";
    public static String GET_ALMANACAPIKEY = "acc4d514286113ef626ba8d4b801fe28";

    public static String WuXing="";

    public static String Pengzuone="",Pengzutwo="",XingXiu="";
    public static String ChongSha="",ShengXiao="",FangWei="";
    public static String Niantg="",Yuetg="",Ritg="";
    public static String Niantg1="",Yuetg1="",Ritg1="";
    public static String Niantgs="",Yuetgs="",Ritgs="",Alls="";

    /*************************************************/
    public static String GET_XIONGSHEN, GET_JISHEN, GET_TAISHEN, GET_ZHISHEN;

    public static Calendar getSchemeCalendar(int year, int month, int day, int color, String text) {
        Calendar calendar = new Calendar();
        calendar.setYear(year);
        calendar.setMonth(month);
        calendar.setDay(day);
        calendar.setSchemeColor(color);//如果单独标记颜色、则会使用这个颜色
        calendar.setScheme(text);
        return calendar;
    }


    /**
     * 社会化分享组件方法（微信）
     * @param context 上下文对象
     * @param str  分享描述内容
     * @param title 分享标题
     * @param img_url 分享图片链接
     * @param web_url 分享的网页链接
     */
    public static void Share_wx(Activity context, String str,String title,String img_url,String web_url){
        UMImage image1 = new UMImage(context, img_url);
        UMWeb web1 = new UMWeb(web_url);
        web1.setTitle(title);//标题
        web1.setThumb(image1);  //缩略图
        web1.setDescription(str);//描述
        new ShareAction(context).setPlatform(SHARE_MEDIA.WEIXIN).withText(title)
                .withMedia(web1)
                .share();
    }


    public static Address getGeoPointBystr(Context context, String str) {
        Address address_temp = null;
        if (str != null) {
            Geocoder gc = new Geocoder(context, Locale.CHINA);
            List<Address> addressList = null;
            try {
                addressList = gc.getFromLocationName(str, 1);
                if (!addressList.isEmpty()) {
                    address_temp = addressList.get(0);
                    double Latitude = address_temp.getLatitude();
                    double Longitude = address_temp.getLongitude();
                    Url.latitude = Latitude + "";
                    Url.longitude = Longitude + "";
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return address_temp;
    }

    /**
     * 图片加载方法
     *
     * @param activity 上下文对象
     * @param url      图片路径
     * @param view     图片控件
     */
    public static void GET_IMAGE(Context activity, String url, ImageView view) {
        Glide.with(activity)
                .load(url)
                .into(view);
    }
    /**
     * 检查是否已经添加了日历账户，如果没有添加先添加一个日历账户再查询
     * 获取账户成功返回账户id，否则返回-1
     */
    public static int checkAndAddCalendarAccount(Context context) {
        int oldId = checkCalendarAccount(context);
        if (oldId >= 0) {
            return oldId;
        } else {
            long addId = addCalendarAccount(context);
            if (addId >= 0) {
                return checkCalendarAccount(context);
            } else {
                return -1;
            }
        }
    }

    /*
     * 将时间转换为时间戳
     */
    public static long dateToStamp(String s) throws ParseException {
        String res;
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        Date date = simpleDateFormat.parse(s);
        long ts = date.getTime();
        res = String.valueOf(ts);
        return ts;
    }

    /**
     * 检查是否存在现有账户，存在则返回账户id，否则返回-1
     */
    public static int checkCalendarAccount(Context context) {
        Cursor userCursor = context.getContentResolver().query(Uri.parse(CALENDER_URL), null, null, null, null);
        try {
            if (userCursor == null) { //查询返回空值
                return -1;
            }
            int count = userCursor.getCount();
            if (count > 0) { //存在现有账户，取第一个账户的id返回
                userCursor.moveToFirst();
                return userCursor.getInt(userCursor.getColumnIndex(CalendarContract.Calendars._ID));
            } else {
                return -1;
            }
        } finally {
            if (userCursor != null) {
                userCursor.close();
            }
        }
    }


    /**
     * 添加日历账户，账户创建成功则返回账户id，否则返回-1
     */
    public static long addCalendarAccount(Context context) {
        TimeZone timeZone = TimeZone.getDefault();
        ContentValues value = new ContentValues();
        value.put(CalendarContract.Calendars.NAME, CALENDARS_NAME);
        value.put(CalendarContract.Calendars.ACCOUNT_NAME, CALENDARS_ACCOUNT_NAME);
        value.put(CalendarContract.Calendars.ACCOUNT_TYPE, CALENDARS_ACCOUNT_TYPE);
        value.put(CalendarContract.Calendars.CALENDAR_DISPLAY_NAME, CALENDARS_DISPLAY_NAME);
        value.put(CalendarContract.Calendars.VISIBLE, 1);
        value.put(CalendarContract.Calendars.CALENDAR_COLOR, Color.BLUE);
        value.put(CalendarContract.Calendars.CALENDAR_ACCESS_LEVEL, CalendarContract.Calendars.CAL_ACCESS_OWNER);
        value.put(CalendarContract.Calendars.SYNC_EVENTS, 1);
        value.put(CalendarContract.Calendars.CALENDAR_TIME_ZONE, timeZone.getID());
        value.put(CalendarContract.Calendars.OWNER_ACCOUNT, CALENDARS_ACCOUNT_NAME);
        value.put(CalendarContract.Calendars.CAN_ORGANIZER_RESPOND, 0);
        Uri calendarUri = Uri.parse(CALENDER_URL);
        calendarUri = calendarUri.buildUpon()
                .appendQueryParameter(CalendarContract.CALLER_IS_SYNCADAPTER, "true")
                .appendQueryParameter(CalendarContract.Calendars.ACCOUNT_NAME, CALENDARS_ACCOUNT_NAME)
                .appendQueryParameter(CalendarContract.Calendars.ACCOUNT_TYPE, CALENDARS_ACCOUNT_TYPE)
                .build();
        Uri result = context.getContentResolver().insert(calendarUri, value);
        long id = result == null ? -1 : ContentUris.parseId(result);
        return id;
    }

    public static String gettime(String time) {
        SimpleDateFormat formatter = new SimpleDateFormat("HH:mm");
        String timestr;
        Date gettime = new Date(System.currentTimeMillis());
        timestr = formatter.format(gettime);
        return timestr;
    }

    /**
     * 打印日志
     * @param logstr 打印的参数
     */
    public static void setlog(String logstr){
        Log.d("apidebug",logstr);
    }

    /**
     * 检查日历事件
     *
     * @param context
     * @param title
     */
    public static boolean checkCalendarEvent(Context context, String title, String description) {
        if (context == null) {
            return false;
        }
        Cursor eventCursor = context.getContentResolver().query(Uri.parse(CALENDER_EVENT_URL), null, null, null, null);
        try {
            if (eventCursor == null) { //查询返回空值
                return false;
            }
            Apiutils.SetLog(eventCursor.getCount() + "");
            if (eventCursor.getCount() > 0) {
                //遍历所有事件，找到title跟需要查询的title一样的项
                String eventTitle = "";
                String eventDescription = "";
                long eventStartTime;
                long eventEndTime;
                while (eventCursor.moveToNext()) {
                    eventTitle = eventCursor.getString(eventCursor.getColumnIndex("title"));
                    eventDescription = eventCursor.getString(eventCursor.getColumnIndex("description"));
                    eventStartTime = Long.parseLong(eventCursor.getString(eventCursor.getColumnIndex("dtstart")));
                    Apiutils.SetLog(eventDescription + "：" + eventStartTime);
                    eventEndTime = Long.parseLong(eventCursor.getString(eventCursor.getColumnIndex("dtend")));
                    Apiutils.SetLog(gettime(eventEndTime + ""));
//                    if ((title != null && title.equals(eventTitle)) && (description != null && description.equals(eventDescription)) && (startTime == eventStartTime) && (endTime == eventEndTime)) {
//                        return true;
//                    }
                }
            }
        } finally {
            if (eventCursor != null) {
                eventCursor.close();
            }
        }
        return false;
    }

    /**
     * 判断是否有网络连接
     *
     * @param context
     * @return
     */
    public static boolean isNetworkConnected(Context context) {
        if (context != null) {
            ConnectivityManager mConnectivityManager = (ConnectivityManager) context
                    .getSystemService(Context.CONNECTIVITY_SERVICE);
            NetworkInfo mNetworkInfo = mConnectivityManager.getActiveNetworkInfo();
            if (mNetworkInfo != null) {
                return mNetworkInfo.isAvailable();
            }
        }
        return false;
    }

    public static String GANZHI = "";
    public static JSONObject success_Object;
    public static AlmanacModel almanacModel;

    public static void getSyn(final String url) {
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    //创建OkHttpClient对象
                    OkHttpClient client = new OkHttpClient();
                    //创建Request
                    Request request = new Request.Builder()
                            .url(url)//访问连接
                            .get()
                            .build();
                    //创建Call对象
                    Call call = client.newCall(request);
                    //通过execute()方法获得请求响应的Response对象
                    Response response = call.execute();
                    if (response.isSuccessful()) {
                        //处理网络请求的响应，处理UI需要在UI线程中处理
                        String result = response.body().string();
                        success_Object = new JSONObject(result);
                        String getcode = success_Object.getString("msg");
                        if ("success".equals(getcode)) {
                            Gson gson = new Gson();
                            almanacModel = gson.fromJson(result,
                                    AlmanacModel.class);
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }).start();
    }

    /**
     * 判断MOBILE网络是否可用
     *
     * @param context
     * @return
     */
    public static boolean isMobileConnected(Context context) {
        if (context != null) {
            ConnectivityManager mConnectivityManager = (ConnectivityManager) context
                    .getSystemService(Context.CONNECTIVITY_SERVICE);
            NetworkInfo mMobileNetworkInfo = mConnectivityManager
                    .getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
            if (mMobileNetworkInfo != null) {
                return mMobileNetworkInfo.isAvailable();
            }
        }
        return false;
    }

    /**
     * 整合Toast工具
     *
     * @param context
     * @param strmsg
     */
    public static void SetToast(Context context, String strmsg) {
        Toast.makeText(context, strmsg, Toast.LENGTH_SHORT).show();
    }

    /**
     * 整合Toast工具
     *
     * @param context
     * @param id      用于获取R文件里的字符串
     */
    public static void SetToast(Context context, int id) {
        Toast.makeText(context, id, Toast.LENGTH_SHORT).show();
    }

    /**
     * 判断当前时辰
     * @return
     */
    /**
     * 判断当前系统时间是否在特定时间的段内
     *
     * @param beginHour 开始的小时，例如5
     * @param beginMin  开始小时的分钟数，例如00
     * @param endHour   结束小时，例如 8
     * @param endMin    结束小时的分钟数，例如00
     * @return true表示在范围内，否则false
     */
    public static boolean isCurrentInTimeScope(int beginHour, int beginMin, int endHour, int endMin) {
        boolean result = false;// 结果
        final long aDayInMillis = 1000 * 60 * 60 * 24;// 一天的全部毫秒数
        final long currentTimeMillis = System.currentTimeMillis();// 当前时间

        Time now = new Time();// 注意这里导入的时候选择android.text.format.Time类,而不是java.sql.Time类
        now.set(currentTimeMillis);

        Time startTime = new Time();
        startTime.set(currentTimeMillis);
        startTime.hour = beginHour;
        startTime.minute = beginMin;

        Time endTime = new Time();
        endTime.set(currentTimeMillis);
        endTime.hour = endHour;
        endTime.minute = endMin;

        if (!startTime.before(endTime)) {
            // 跨天的特殊情况（比如22:00-8:00）
            startTime.set(startTime.toMillis(true) - aDayInMillis);
            result = !now.before(startTime) && !now.after(endTime); // startTime <= now <= endTime
            Time startTimeInThisDay = new Time();
            startTimeInThisDay.set(startTime.toMillis(true) + aDayInMillis);
            if (!now.before(startTimeInThisDay)) {
                result = true;
            }
        } else {
            // 普通情况(比如 8:00 - 14:00)
            result = !now.before(startTime) && !now.after(endTime); // startTime <= now <= endTime
        }
        return result;
    }

    public static int selectcolor(int nowtime) {
        int i = 0;
        if (nowtime >= 1 && nowtime < 3) {
            i = 1;
        } else if (nowtime >= 3 && nowtime < 5) {
            i = 2;
        } else if (nowtime >= 5 && nowtime < 7) {
            i = 3;
        } else if (nowtime >= 7 && nowtime < 9) {
            i = 4;
        } else if (nowtime >= 9 && nowtime < 11) {
            i = 5;
        } else if (nowtime >= 11 && nowtime < 13) {
            i = 6;
        } else if (nowtime >= 13 && nowtime < 15) {
            i = 7;
        } else if (nowtime >= 15 && nowtime < 17) {
            i = 8;
        } else if (nowtime >= 17 && nowtime < 19) {
            i = 9;
        } else if (nowtime >= 19 & nowtime < 21) {
            i = 10;
        } else if (nowtime >= 21 && nowtime < 23) {
            i = 11;
        } else {
            i = 0;
        }
        return i;
    }


    /**
     * 调试日志
     *
     * @param stamsg 传递需要打印的值（查看打印的值：apidebug）
     */
    public static void SetLog(String stamsg) {
        Log.d("apidebug", stamsg);
    }

    /**
     * 换算当前是周几
     *
     * @param mWay 传入的星期几的变量
     * @return
     */

    public static String GetWeekday(int mWay) {
        String mway;
        if (mWay == 1) {
            mway = "天";
            return mway;
        } else if (mWay == 2) {
            mway = "一";
            return mway;
        } else if (mWay == 3) {
            mway = "二";
            return mway;
        } else if (mWay == 4) {
            mway = "三";
            return mway;
        } else if (mWay == 5) {
            mway = "四";
            return mway;
        } else if (mWay == 6) {
            mway = "五";
            return mway;
        } else if (mWay == 7) {
            mway = "六";
            return mway;
        }
        return null;
    }


    public static String JSONCODE = "{\n" +
            "\t\"code\": 200,\n" +
            "\t\"msg\": \"success\",\n" +
            "\t\"newslist\": [{\n" +
            "\t\t\t\"ganzhi\": \"丙戌\",\n" +
            "\t\t\t\"name\": \"屋上土\",\n" +
            "\t\t\t\"taishen\": \"厨灶栖外西北\",\n" +
            "\t\t\t\"chongsha\": \"冲龙 煞北\",\n" +
            "\t\t\t\"fangwei\": \"西南|正东|西南\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|凶|吉|吉|凶|凶|吉|吉|凶|吉\",\n" +
            "\t\t\t\"sui\": \"1\",\n" +
            "\t\t\t\"nan\": \"3\",\n" +
            "\t\t\t\"nv\": \"3\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"乙酉\",\n" +
            "\t\t\t\"name\": \"泉中水\",\n" +
            "\t\t\t\"taishen\": \"碓磨门外西北\",\n" +
            "\t\t\t\"chongsha\": \"冲兔 煞东\",\n" +
            "\t\t\t\"fangwei\": \"西北|东南|东北\",\n" +
            "\t\t\t\"shijian\": \"吉|凶|吉|吉|凶|凶|吉|吉|凶|吉|凶|凶\",\n" +
            "\t\t\t\"sui\": \"2\",\n" +
            "\t\t\t\"nan\": \"4\",\n" +
            "\t\t\t\"nv\": \"2\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"甲申\",\n" +
            "\t\t\t\"name\": \"泉中水\",\n" +
            "\t\t\t\"taishen\": \"占门炉外西北\",\n" +
            "\t\t\t\"chongsha\": \"冲虎 煞南\",\n" +
            "\t\t\t\"fangwei\": \"东北|东南|东北\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|凶|吉|吉|凶|吉|凶|凶|吉|凶\",\n" +
            "\t\t\t\"sui\": \"3\",\n" +
            "\t\t\t\"nan\": \"5\",\n" +
            "\t\t\t\"nv\": \"1\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"癸未\",\n" +
            "\t\t\t\"name\": \"杨柳木\",\n" +
            "\t\t\t\"taishen\": \"房床厕外西北\",\n" +
            "\t\t\t\"chongsha\": \"冲牛(丁丑)煞西\",\n" +
            "\t\t\t\"fangwei\": \"东南|正西|正南\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|吉|凶|吉|凶|凶|吉|凶|吉|吉\",\n" +
            "\t\t\t\"sui\": \"4\",\n" +
            "\t\t\t\"nan\": \"6\",\n" +
            "\t\t\t\"nv\": \"9\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"壬午\",\n" +
            "\t\t\t\"name\": \"杨柳木\",\n" +
            "\t\t\t\"taishen\": \"仓库碓外西北\",\n" +
            "\t\t\t\"chongsha\": \"冲鼠 煞北\",\n" +
            "\t\t\t\"fangwei\": \"正南|西北|正南\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|吉|凶|凶|吉|凶|吉|吉|凶|凶\",\n" +
            "\t\t\t\"sui\": \"5\",\n" +
            "\t\t\t\"nan\": \"7\",\n" +
            "\t\t\t\"nv\": \"8\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"辛巳\",\n" +
            "\t\t\t\"name\": \"白蜡金\",\n" +
            "\t\t\t\"taishen\": \"厨灶床外正西\",\n" +
            "\t\t\t\"chongsha\": \"冲猪 煞东\",\n" +
            "\t\t\t\"fangwei\": \"西南|西南|正东\",\n" +
            "\t\t\t\"shijian\": \"凶|吉|凶|凶|吉|凶|吉|吉|凶|凶|吉|凶\",\n" +
            "\t\t\t\"sui\": \"6\",\n" +
            "\t\t\t\"nan\": \"8\",\n" +
            "\t\t\t\"nv\": \"7\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"庚辰\",\n" +
            "\t\t\t\"name\": \"白蜡金\",\n" +
            "\t\t\t\"taishen\": \"碓磨栖外正西\",\n" +
            "\t\t\t\"chongsha\": \"冲狗 煞南\",\n" +
            "\t\t\t\"fangwei\": \"西北|西南|正东\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|凶|吉|吉|凶|凶|凶|吉|凶|吉\",\n" +
            "\t\t\t\"sui\": \"7\",\n" +
            "\t\t\t\"nan\": \"9\",\n" +
            "\t\t\t\"nv\": \"6\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"己卯\",\n" +
            "\t\t\t\"name\": \"城墙土\",\n" +
            "\t\t\t\"taishen\": \"占门厕外正南\",\n" +
            "\t\t\t\"chongsha\": \"冲鸡(癸酉)煞西\",\n" +
            "\t\t\t\"fangwei\": \"东北|正南|正北\",\n" +
            "\t\t\t\"shijian\": \"吉|凶|吉|吉|凶|凶|吉|吉|凶|吉|凶|凶\",\n" +
            "\t\t\t\"sui\": \"8\",\n" +
            "\t\t\t\"nan\": \"1\",\n" +
            "\t\t\t\"nv\": \"5\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"戊寅\",\n" +
            "\t\t\t\"name\": \"城墙土\",\n" +
            "\t\t\t\"taishen\": \"房床厕外正南\",\n" +
            "\t\t\t\"chongsha\": \"冲猴 煞北\",\n" +
            "\t\t\t\"fangwei\": \"东南|正北|正北\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|凶|吉|吉|凶|吉|凶|凶|吉|凶\",\n" +
            "\t\t\t\"sui\": \"9\",\n" +
            "\t\t\t\"nan\": \"2\",\n" +
            "\t\t\t\"nv\": \"4\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"丁丑\",\n" +
            "\t\t\t\"name\": \"涧下水\",\n" +
            "\t\t\t\"taishen\": \"仓库厕外西南\",\n" +
            "\t\t\t\"chongsha\": \"冲羊 煞东\",\n" +
            "\t\t\t\"fangwei\": \"正南|正东|西南\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|吉|凶|吉|凶|凶|吉|凶|吉|吉\",\n" +
            "\t\t\t\"sui\": \"10\",\n" +
            "\t\t\t\"nan\": \"3\",\n" +
            "\t\t\t\"nv\": \"3\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"丙子\",\n" +
            "\t\t\t\"name\": \"涧下水\",\n" +
            "\t\t\t\"taishen\": \"厨灶碓外西南\",\n" +
            "\t\t\t\"chongsha\": \"冲马 煞南\",\n" +
            "\t\t\t\"fangwei\": \"西南|正东|西南\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|吉|凶|凶|吉|凶|吉|吉|凶|凶\",\n" +
            "\t\t\t\"sui\": \"11\",\n" +
            "\t\t\t\"nan\": \"4\",\n" +
            "\t\t\t\"nv\": \"2\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"乙亥\",\n" +
            "\t\t\t\"name\": \"山头火\",\n" +
            "\t\t\t\"taishen\": \"碓磨床外西南\",\n" +
            "\t\t\t\"chongsha\": \"冲蛇 煞西\",\n" +
            "\t\t\t\"fangwei\": \"西北|东南|东北\",\n" +
            "\t\t\t\"shijian\": \"凶|吉|凶|凶|吉|凶|吉|凶|凶|凶|吉|吉\",\n" +
            "\t\t\t\"sui\": \"12\",\n" +
            "\t\t\t\"nan\": \"5\",\n" +
            "\t\t\t\"nv\": \"1\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"甲戌\",\n" +
            "\t\t\t\"name\": \"山头火\",\n" +
            "\t\t\t\"taishen\": \"门鸡栖外西南\",\n" +
            "\t\t\t\"chongsha\": \"冲龙 煞北\",\n" +
            "\t\t\t\"fangwei\": \"东北|东南|东北\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|凶|吉|吉|凶|吉|吉|吉|凶|吉\",\n" +
            "\t\t\t\"sui\": \"13\",\n" +
            "\t\t\t\"nan\": \"6\",\n" +
            "\t\t\t\"nv\": \"9\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"癸酉\",\n" +
            "\t\t\t\"name\": \"剑锋金\",\n" +
            "\t\t\t\"taishen\": \"房床门外西南\",\n" +
            "\t\t\t\"chongsha\": \"冲兔 煞东\",\n" +
            "\t\t\t\"fangwei\": \"东南|正西|正南\",\n" +
            "\t\t\t\"shijian\": \"吉|凶|吉|吉|凶|凶|吉|吉|凶|吉|凶|凶\",\n" +
            "\t\t\t\"sui\": \"14\",\n" +
            "\t\t\t\"nan\": \"7\",\n" +
            "\t\t\t\"nv\": \"8\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"壬申\",\n" +
            "\t\t\t\"name\": \"剑锋金\",\n" +
            "\t\t\t\"taishen\": \"仓库炉外西南\",\n" +
            "\t\t\t\"chongsha\": \"冲虎 煞南\",\n" +
            "\t\t\t\"fangwei\": \"正南|西北|正南\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|凶|吉|吉|凶|吉|凶|凶|吉|凶\",\n" +
            "\t\t\t\"sui\": \"15\",\n" +
            "\t\t\t\"nan\": \"8\",\n" +
            "\t\t\t\"nv\": \"7\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"辛未\",\n" +
            "\t\t\t\"name\": \"路旁土\",\n" +
            "\t\t\t\"taishen\": \"厨灶厕外西南\",\n" +
            "\t\t\t\"chongsha\": \"冲牛 煞西\",\n" +
            "\t\t\t\"fangwei\": \"西南|西南|正东\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|吉|凶|吉|凶|凶|吉|凶|吉|吉\",\n" +
            "\t\t\t\"sui\": \"16\",\n" +
            "\t\t\t\"nan\": \"9\",\n" +
            "\t\t\t\"nv\": \"6\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"庚午\",\n" +
            "\t\t\t\"name\": \"路旁土\",\n" +
            "\t\t\t\"taishen\": \"占碓磨外正南\",\n" +
            "\t\t\t\"chongsha\": \"冲鼠 煞北\",\n" +
            "\t\t\t\"fangwei\": \"西北|西南|正东\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|吉|凶|凶|吉|凶|吉|吉|凶|凶\",\n" +
            "\t\t\t\"sui\": \"17\",\n" +
            "\t\t\t\"nan\": \"1\",\n" +
            "\t\t\t\"nv\": \"5\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"己巳\",\n" +
            "\t\t\t\"name\": \"大林木\",\n" +
            "\t\t\t\"taishen\": \"占门床外正南\",\n" +
            "\t\t\t\"chongsha\": \"冲猪 煞东\",\n" +
            "\t\t\t\"fangwei\": \"东北|正南|正北\",\n" +
            "\t\t\t\"shijian\": \"凶|吉|凶|凶|吉|凶|吉|吉|凶|凶|吉|吉\",\n" +
            "\t\t\t\"sui\": \"18\",\n" +
            "\t\t\t\"nan\": \"2\",\n" +
            "\t\t\t\"nv\": \"4\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"戊辰\",\n" +
            "\t\t\t\"name\": \"大林木\",\n" +
            "\t\t\t\"taishen\": \"房床栖外正南\",\n" +
            "\t\t\t\"chongsha\": \"冲狗 煞南\",\n" +
            "\t\t\t\"fangwei\": \"东南|正北|正北\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|凶|吉|吉|凶|凶|吉|吉|凶|吉\",\n" +
            "\t\t\t\"sui\": \"19\",\n" +
            "\t\t\t\"nan\": \"3\",\n" +
            "\t\t\t\"nv\": \"3\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"丁卯\",\n" +
            "\t\t\t\"name\": \"炉中火\",\n" +
            "\t\t\t\"taishen\": \"仓库门外正南\",\n" +
            "\t\t\t\"chongsha\": \"冲鸡 煞西\",\n" +
            "\t\t\t\"fangwei\": \"正南|正东|西南\",\n" +
            "\t\t\t\"shijian\": \"吉|凶|吉|吉|凶|凶|吉|吉|凶|吉|凶|凶\",\n" +
            "\t\t\t\"sui\": \"20\",\n" +
            "\t\t\t\"nan\": \"4\",\n" +
            "\t\t\t\"nv\": \"2\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"丙寅\",\n" +
            "\t\t\t\"name\": \"炉中火\",\n" +
            "\t\t\t\"taishen\": \"厨灶炉外正南\",\n" +
            "\t\t\t\"chongsha\": \"冲猴 煞北\",\n" +
            "\t\t\t\"fangwei\": \"西南|正东|西南\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|凶|吉|吉|凶|吉|凶|凶|吉|凶\",\n" +
            "\t\t\t\"sui\": \"21\",\n" +
            "\t\t\t\"nan\": \"5\",\n" +
            "\t\t\t\"nv\": \"1\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"乙丑\",\n" +
            "\t\t\t\"name\": \"海中金\",\n" +
            "\t\t\t\"taishen\": \"碓磨厕外东南\",\n" +
            "\t\t\t\"chongsha\": \"冲羊 煞东\",\n" +
            "\t\t\t\"fangwei\": \"西北|东南|东北\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|吉|凶|吉|凶|凶|吉|凶|吉|吉\",\n" +
            "\t\t\t\"sui\": \"22\",\n" +
            "\t\t\t\"nan\": \"6\",\n" +
            "\t\t\t\"nv\": \"9\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"甲子\",\n" +
            "\t\t\t\"name\": \"海中金\",\n" +
            "\t\t\t\"taishen\": \"占门碓外东南\",\n" +
            "\t\t\t\"chongsha\": \"冲马 煞南\",\n" +
            "\t\t\t\"fangwei\": \"东北|东南|东北\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|吉|凶|凶|吉|凶|吉|吉|凶|凶\",\n" +
            "\t\t\t\"sui\": \"23\",\n" +
            "\t\t\t\"nan\": \"7\",\n" +
            "\t\t\t\"nv\": \"8\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"癸亥\",\n" +
            "\t\t\t\"name\": \"大海水\",\n" +
            "\t\t\t\"taishen\": \"占房床外东南\",\n" +
            "\t\t\t\"chongsha\": \"冲蛇 煞西\",\n" +
            "\t\t\t\"fangwei\": \"东南|正西|正南\",\n" +
            "\t\t\t\"shijian\": \"凶|吉|凶|凶|吉|凶|吉|吉|凶|凶|吉|吉\",\n" +
            "\t\t\t\"sui\": \"24\",\n" +
            "\t\t\t\"nan\": \"8\",\n" +
            "\t\t\t\"nv\": \"7\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"壬戌\",\n" +
            "\t\t\t\"name\": \"大海水\",\n" +
            "\t\t\t\"taishen\": \"仓库栖外东南\",\n" +
            "\t\t\t\"chongsha\": \"冲龙 煞北\",\n" +
            "\t\t\t\"fangwei\": \"正南|西北|正南\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|凶|吉|吉|凶|凶|吉|吉|凶|吉\",\n" +
            "\t\t\t\"sui\": \"25\",\n" +
            "\t\t\t\"nan\": \"9\",\n" +
            "\t\t\t\"nv\": \"6\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"辛酉\",\n" +
            "\t\t\t\"name\": \"石榴木\",\n" +
            "\t\t\t\"taishen\": \"厨灶门外东南\",\n" +
            "\t\t\t\"chongsha\": \"冲兔 煞东\",\n" +
            "\t\t\t\"fangwei\": \"西南|西南|正东\",\n" +
            "\t\t\t\"shijian\": \"吉|凶|吉|吉|凶|凶|吉|吉|凶|吉|凶|凶\",\n" +
            "\t\t\t\"sui\": \"26\",\n" +
            "\t\t\t\"nan\": \"1\",\n" +
            "\t\t\t\"nv\": \"5\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"庚申\",\n" +
            "\t\t\t\"name\": \"石榴木\",\n" +
            "\t\t\t\"taishen\": \"碓磨炉外东南\",\n" +
            "\t\t\t\"chongsha\": \"冲虎 煞南\",\n" +
            "\t\t\t\"fangwei\": \"西北|西南|正东\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|凶|吉|吉|吉|吉|凶|凶|吉|凶\",\n" +
            "\t\t\t\"sui\": \"27\",\n" +
            "\t\t\t\"nan\": \"2\",\n" +
            "\t\t\t\"nv\": \"4\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"己未\",\n" +
            "\t\t\t\"name\": \"天上火\",\n" +
            "\t\t\t\"taishen\": \"占门厕外正东\",\n" +
            "\t\t\t\"chongsha\": \"冲牛 煞西\",\n" +
            "\t\t\t\"fangwei\": \"东北|正南|正北\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|吉|凶|吉|凶|凶|吉|凶|吉|吉\",\n" +
            "\t\t\t\"sui\": \"28\",\n" +
            "\t\t\t\"nan\": \"3\",\n" +
            "\t\t\t\"nv\": \"3\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"戊午\",\n" +
            "\t\t\t\"name\": \"天上火\",\n" +
            "\t\t\t\"taishen\": \"房床碓外正东\",\n" +
            "\t\t\t\"chongsha\": \"冲鼠 煞北\",\n" +
            "\t\t\t\"fangwei\": \"东南|正北|正北\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|吉|凶|凶|吉|凶|吉|吉|凶|凶\",\n" +
            "\t\t\t\"sui\": \"29\",\n" +
            "\t\t\t\"nan\": \"4\",\n" +
            "\t\t\t\"nv\": \"2\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"丁巳\",\n" +
            "\t\t\t\"name\": \"沙中土\",\n" +
            "\t\t\t\"taishen\": \"仓库床外正东\",\n" +
            "\t\t\t\"chongsha\": \"冲猪 煞东\",\n" +
            "\t\t\t\"fangwei\": \"正南|正东|西南\",\n" +
            "\t\t\t\"shijian\": \"凶|吉|凶|凶|吉|凶|吉|吉|凶|凶|吉|吉\",\n" +
            "\t\t\t\"sui\": \"30\",\n" +
            "\t\t\t\"nan\": \"5\",\n" +
            "\t\t\t\"nv\": \"1\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"丙辰\",\n" +
            "\t\t\t\"name\": \"沙中土\",\n" +
            "\t\t\t\"taishen\": \"厨灶栖外正东\",\n" +
            "\t\t\t\"chongsha\": \"冲狗 煞南\",\n" +
            "\t\t\t\"fangwei\": \"西南|正东|西南\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|凶|吉|吉|凶|凶|吉|吉|凶|吉\",\n" +
            "\t\t\t\"sui\": \"31\",\n" +
            "\t\t\t\"nan\": \"6\",\n" +
            "\t\t\t\"nv\": \"9\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"乙卯\",\n" +
            "\t\t\t\"name\": \"大溪水\",\n" +
            "\t\t\t\"taishen\": \"碓磨门外正东\",\n" +
            "\t\t\t\"chongsha\": \"冲鸡 煞西\",\n" +
            "\t\t\t\"fangwei\": \"西北|东南|东北\",\n" +
            "\t\t\t\"shijian\": \"吉|凶|吉|吉|凶|凶|吉|吉|凶|吉|凶|凶\",\n" +
            "\t\t\t\"sui\": \"32\",\n" +
            "\t\t\t\"nan\": \"7\",\n" +
            "\t\t\t\"nv\": \"8\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"甲寅\",\n" +
            "\t\t\t\"name\": \"大溪水\",\n" +
            "\t\t\t\"taishen\": \"占门炉外东北\",\n" +
            "\t\t\t\"chongsha\": \"冲猴 煞北\",\n" +
            "\t\t\t\"fangwei\": \"东北|东南|东北\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|凶|吉|吉|凶|吉|凶|凶|吉|凶\",\n" +
            "\t\t\t\"sui\": \"33\",\n" +
            "\t\t\t\"nan\": \"8\",\n" +
            "\t\t\t\"nv\": \"7\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"癸丑\",\n" +
            "\t\t\t\"name\": \"桑松木\",\n" +
            "\t\t\t\"taishen\": \"房床厕外东北\",\n" +
            "\t\t\t\"chongsha\": \"冲羊 煞东\",\n" +
            "\t\t\t\"fangwei\": \"东南|正西|正南\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|吉|凶|吉|凶|凶|吉|凶|吉|吉\",\n" +
            "\t\t\t\"sui\": \"34\",\n" +
            "\t\t\t\"nan\": \"9\",\n" +
            "\t\t\t\"nv\": \"6\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"壬子\",\n" +
            "\t\t\t\"name\": \"桑松木\",\n" +
            "\t\t\t\"taishen\": \"仓库碓外东北\",\n" +
            "\t\t\t\"chongsha\": \"冲马 煞南\",\n" +
            "\t\t\t\"fangwei\": \"正南|西北|正南\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|吉|凶|凶|吉|凶|吉|吉|凶|凶\",\n" +
            "\t\t\t\"sui\": \"35\",\n" +
            "\t\t\t\"nan\": \"1\",\n" +
            "\t\t\t\"nv\": \"5\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"辛亥\",\n" +
            "\t\t\t\"name\": \"钗钏金\",\n" +
            "\t\t\t\"taishen\": \"厨灶床外东北\",\n" +
            "\t\t\t\"chongsha\": \"冲蛇 煞西\",\n" +
            "\t\t\t\"fangwei\": \"西南|西南|正东\",\n" +
            "\t\t\t\"shijian\": \"凶|吉|凶|凶|吉|凶|吉|凶|凶|凶|吉|吉\",\n" +
            "\t\t\t\"sui\": \"36\",\n" +
            "\t\t\t\"nan\": \"2\",\n" +
            "\t\t\t\"nv\": \"4\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"庚戌\",\n" +
            "\t\t\t\"name\": \"钗钏金\",\n" +
            "\t\t\t\"taishen\": \"碓磨栖外东北\",\n" +
            "\t\t\t\"chongsha\": \"冲龙 煞北\",\n" +
            "\t\t\t\"fangwei\": \"西北|西南|正东\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|凶|吉|吉|凶|凶|吉|吉|凶|吉\",\n" +
            "\t\t\t\"sui\": \"37\",\n" +
            "\t\t\t\"nan\": \"3\",\n" +
            "\t\t\t\"nv\": \"3\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"己酉\",\n" +
            "\t\t\t\"name\": \"大驿土\",\n" +
            "\t\t\t\"taishen\": \"占大门外东北\",\n" +
            "\t\t\t\"chongsha\": \"冲兔 煞东\",\n" +
            "\t\t\t\"fangwei\": \"东北|正南|正北\",\n" +
            "\t\t\t\"shijian\": \"吉|凶|吉|吉|凶|凶|吉|吉|凶|吉|凶|凶\",\n" +
            "\t\t\t\"sui\": \"38\",\n" +
            "\t\t\t\"nan\": \"4\",\n" +
            "\t\t\t\"nv\": \"2\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"戊申\",\n" +
            "\t\t\t\"name\": \"大驿土\",\n" +
            "\t\t\t\"taishen\": \"房床炉房内东\",\n" +
            "\t\t\t\"chongsha\": \"冲虎 煞南\",\n" +
            "\t\t\t\"fangwei\": \"东南|正北|正北\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|凶|吉|吉|凶|吉|凶|凶|吉|凶\",\n" +
            "\t\t\t\"sui\": \"39\",\n" +
            "\t\t\t\"nan\": \"5\",\n" +
            "\t\t\t\"nv\": \"1\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"丁未\",\n" +
            "\t\t\t\"name\": \"天河水\",\n" +
            "\t\t\t\"taishen\": \"仓库厕房内东\",\n" +
            "\t\t\t\"chongsha\": \"冲牛 煞西\",\n" +
            "\t\t\t\"fangwei\": \"正南|正东|西南\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|吉|凶|吉|凶|凶|吉|凶|吉|吉\",\n" +
            "\t\t\t\"sui\": \"40\",\n" +
            "\t\t\t\"nan\": \"6\",\n" +
            "\t\t\t\"nv\": \"9\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"丙午\",\n" +
            "\t\t\t\"name\": \"天河水\",\n" +
            "\t\t\t\"taishen\": \"厨灶碓房内东\",\n" +
            "\t\t\t\"chongsha\": \"冲鼠 煞北\",\n" +
            "\t\t\t\"fangwei\": \"西南|正东|西南\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|吉|凶|凶|吉|凶|吉|凶|凶|凶\",\n" +
            "\t\t\t\"sui\": \"41\",\n" +
            "\t\t\t\"nan\": \"7\",\n" +
            "\t\t\t\"nv\": \"8\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"乙巳\",\n" +
            "\t\t\t\"name\": \"佛灯火\",\n" +
            "\t\t\t\"taishen\": \"碓磨床房内东\",\n" +
            "\t\t\t\"chongsha\": \"冲猪 煞东\",\n" +
            "\t\t\t\"fangwei\": \"西北|东南|东北\",\n" +
            "\t\t\t\"shijian\": \"凶|吉|凶|凶|吉|凶|吉|凶|凶|凶|吉|吉\",\n" +
            "\t\t\t\"sui\": \"42\",\n" +
            "\t\t\t\"nan\": \"8\",\n" +
            "\t\t\t\"nv\": \"7\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"甲辰\",\n" +
            "\t\t\t\"name\": \"佛灯火\",\n" +
            "\t\t\t\"taishen\": \"门鸡栖房内东\",\n" +
            "\t\t\t\"chongsha\": \"冲狗 煞南\",\n" +
            "\t\t\t\"fangwei\": \"东北|东南|东北\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|凶|吉|吉|凶|凶|吉|吉|凶|吉\",\n" +
            "\t\t\t\"sui\": \"43\",\n" +
            "\t\t\t\"nan\": \"9\",\n" +
            "\t\t\t\"nv\": \"6\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"癸卯\",\n" +
            "\t\t\t\"name\": \"金箔金\",\n" +
            "\t\t\t\"taishen\": \"房床门房内南\",\n" +
            "\t\t\t\"chongsha\": \"冲鸡 煞西\",\n" +
            "\t\t\t\"fangwei\": \"东南|正西|正南\",\n" +
            "\t\t\t\"shijian\": \"吉|凶|吉|吉|凶|凶|吉|凶|凶|吉|凶|凶\",\n" +
            "\t\t\t\"sui\": \"44\",\n" +
            "\t\t\t\"nan\": \"1\",\n" +
            "\t\t\t\"nv\": \"5\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"壬寅\",\n" +
            "\t\t\t\"name\": \"金箔金\",\n" +
            "\t\t\t\"taishen\": \"仓库炉房内南\",\n" +
            "\t\t\t\"chongsha\": \"冲猴 煞北\",\n" +
            "\t\t\t\"fangwei\": \"正南|西北|正南\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|凶|吉|吉|凶|吉|凶|凶|吉|凶\",\n" +
            "\t\t\t\"sui\": \"45\",\n" +
            "\t\t\t\"nan\": \"2\",\n" +
            "\t\t\t\"nv\": \"4\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"辛丑\",\n" +
            "\t\t\t\"name\": \"壁上土\",\n" +
            "\t\t\t\"taishen\": \"厨灶厕房内南\",\n" +
            "\t\t\t\"chongsha\": \"冲羊 煞东\",\n" +
            "\t\t\t\"fangwei\": \"西南|西南|正东\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|吉|凶|吉|凶|凶|吉|凶|吉|吉\",\n" +
            "\t\t\t\"sui\": \"46\",\n" +
            "\t\t\t\"nan\": \"3\",\n" +
            "\t\t\t\"nv\": \"3\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"庚子\",\n" +
            "\t\t\t\"name\": \"壁上土\",\n" +
            "\t\t\t\"taishen\": \"占碓磨房内南\",\n" +
            "\t\t\t\"chongsha\": \"冲马 煞南\",\n" +
            "\t\t\t\"fangwei\": \"西北|西南|正东\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|吉|凶|凶|吉|凶|吉|吉|凶|凶\",\n" +
            "\t\t\t\"sui\": \"47\",\n" +
            "\t\t\t\"nan\": \"4\",\n" +
            "\t\t\t\"nv\": \"2\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"己亥\",\n" +
            "\t\t\t\"name\": \"平地木\",\n" +
            "\t\t\t\"taishen\": \"占门床房内南\",\n" +
            "\t\t\t\"chongsha\": \"冲蛇(癸已)煞西\",\n" +
            "\t\t\t\"fangwei\": \"东北|正南|正北\",\n" +
            "\t\t\t\"shijian\": \"凶|吉|凶|凶|吉|凶|吉|吉|凶|凶|吉|吉\",\n" +
            "\t\t\t\"sui\": \"48\",\n" +
            "\t\t\t\"nan\": \"5\",\n" +
            "\t\t\t\"nv\": \"1\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"戊戌\",\n" +
            "\t\t\t\"name\": \"平地木\",\n" +
            "\t\t\t\"taishen\": \"房床栖房内南\",\n" +
            "\t\t\t\"chongsha\": \"冲龙 煞北\",\n" +
            "\t\t\t\"fangwei\": \"东南|正北|正北\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|凶|吉|吉|凶|凶|吉|吉|凶|吉\",\n" +
            "\t\t\t\"sui\": \"49\",\n" +
            "\t\t\t\"nan\": \"6\",\n" +
            "\t\t\t\"nv\": \"9\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"丁酉\",\n" +
            "\t\t\t\"name\": \"山下火\",\n" +
            "\t\t\t\"taishen\": \"仓库门房内北\",\n" +
            "\t\t\t\"chongsha\": \"冲兔 煞东\",\n" +
            "\t\t\t\"fangwei\": \"正南|正东|西南\",\n" +
            "\t\t\t\"shijian\": \"吉|凶|吉|吉|凶|凶|吉|吉|凶|吉|凶|凶\",\n" +
            "\t\t\t\"sui\": \"50\",\n" +
            "\t\t\t\"nan\": \"7\",\n" +
            "\t\t\t\"nv\": \"8\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"丙申\",\n" +
            "\t\t\t\"name\": \"山下火\",\n" +
            "\t\t\t\"taishen\": \"厨灶炉房内北\",\n" +
            "\t\t\t\"chongsha\": \"冲虎 煞南\",\n" +
            "\t\t\t\"fangwei\": \"西南|正东|西南\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|凶|吉|吉|凶|吉|凶|凶|吉|凶\",\n" +
            "\t\t\t\"sui\": \"51\",\n" +
            "\t\t\t\"nan\": \"8\",\n" +
            "\t\t\t\"nv\": \"7\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"乙未\",\n" +
            "\t\t\t\"name\": \"沙中金\",\n" +
            "\t\t\t\"taishen\": \"碓磨厕房内北\",\n" +
            "\t\t\t\"chongsha\": \"冲牛 煞西\",\n" +
            "\t\t\t\"fangwei\": \"西北|东南|东北\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|吉|凶|吉|凶|凶|吉|凶|吉|吉\",\n" +
            "\t\t\t\"sui\": \"52\",\n" +
            "\t\t\t\"nan\": \"9\",\n" +
            "\t\t\t\"nv\": \"6\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"甲午\",\n" +
            "\t\t\t\"name\": \"沙中金\",\n" +
            "\t\t\t\"taishen\": \"占门碓房内北\",\n" +
            "\t\t\t\"chongsha\": \"冲鼠 煞北\",\n" +
            "\t\t\t\"fangwei\": \"东北|东南|东北\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|吉|凶|凶|吉|凶|吉|吉|凶|凶\",\n" +
            "\t\t\t\"sui\": \"53\",\n" +
            "\t\t\t\"nan\": \"1\",\n" +
            "\t\t\t\"nv\": \"5\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"癸巳\",\n" +
            "\t\t\t\"name\": \"长流水\",\n" +
            "\t\t\t\"taishen\": \"占房床房内北\",\n" +
            "\t\t\t\"chongsha\": \"冲猪 煞东\",\n" +
            "\t\t\t\"fangwei\": \"东南|正西|正南\",\n" +
            "\t\t\t\"shijian\": \"凶|吉|凶|凶|吉|凶|吉|吉|凶|凶|吉|吉\",\n" +
            "\t\t\t\"sui\": \"54\",\n" +
            "\t\t\t\"nan\": \"2\",\n" +
            "\t\t\t\"nv\": \"4\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"壬辰\",\n" +
            "\t\t\t\"name\": \"长流水\",\n" +
            "\t\t\t\"taishen\": \"仓库栖外正北\",\n" +
            "\t\t\t\"chongsha\": \"冲狗 煞南\",\n" +
            "\t\t\t\"fangwei\": \"正南|西北|正南\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|凶|吉|吉|凶|凶|吉|吉|凶|吉\",\n" +
            "\t\t\t\"sui\": \"55\",\n" +
            "\t\t\t\"nan\": \"3\",\n" +
            "\t\t\t\"nv\": \"3\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"辛卯\",\n" +
            "\t\t\t\"name\": \"松柏木\",\n" +
            "\t\t\t\"taishen\": \"厨灶门外正北\",\n" +
            "\t\t\t\"chongsha\": \"冲鸡 煞西\",\n" +
            "\t\t\t\"fangwei\": \"西南|西南|正东\",\n" +
            "\t\t\t\"shijian\": \"吉|凶|吉|吉|凶|凶|吉|吉|凶|吉|凶|凶\",\n" +
            "\t\t\t\"sui\": \"56\",\n" +
            "\t\t\t\"nan\": \"4\",\n" +
            "\t\t\t\"nv\": \"2\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"庚寅\",\n" +
            "\t\t\t\"name\": \"松柏木\",\n" +
            "\t\t\t\"taishen\": \"碓磨炉外正北\",\n" +
            "\t\t\t\"chongsha\": \"冲猴 煞北\",\n" +
            "\t\t\t\"fangwei\": \"西北|西南|正东\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|凶|吉|吉|凶|吉|凶|凶|吉|凶\",\n" +
            "\t\t\t\"sui\": \"57\",\n" +
            "\t\t\t\"nan\": \"5\",\n" +
            "\t\t\t\"nv\": \"1\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"己丑\",\n" +
            "\t\t\t\"name\": \"霹雳火\",\n" +
            "\t\t\t\"taishen\": \"占门厕外正北\",\n" +
            "\t\t\t\"chongsha\": \"冲羊 煞东\",\n" +
            "\t\t\t\"fangwei\": \"东北|正南|正北\",\n" +
            "\t\t\t\"shijian\": \"凶|凶|吉|吉|凶|吉|凶|凶|吉|凶|吉|凶\",\n" +
            "\t\t\t\"sui\": \"58\",\n" +
            "\t\t\t\"nan\": \"6\",\n" +
            "\t\t\t\"nv\": \"9\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"戊子\",\n" +
            "\t\t\t\"name\": \"霹雳火\",\n" +
            "\t\t\t\"taishen\": \"房床碓外正北\",\n" +
            "\t\t\t\"chongsha\": \"冲马 煞南\",\n" +
            "\t\t\t\"fangwei\": \"东南|正北|正北\",\n" +
            "\t\t\t\"shijian\": \"吉|吉|凶|吉|凶|凶|吉|凶|吉|吉|凶|凶\",\n" +
            "\t\t\t\"sui\": \"59\",\n" +
            "\t\t\t\"nan\": \"7\",\n" +
            "\t\t\t\"nv\": \"8\"\n" +
            "\t\t},\n" +
            "\t\t{\n" +
            "\t\t\t\"ganzhi\": \"丁亥\",\n" +
            "\t\t\t\"name\": \"屋上土\",\n" +
            "\t\t\t\"taishen\": \"仓库床外西北\",\n" +
            "\t\t\t\"chongsha\": \"冲蛇 煞西\",\n" +
            "\t\t\t\"fangwei\": \"正南|正东|西南\",\n" +
            "\t\t\t\"shijian\": \"凶|吉|凶|凶|吉|凶|吉|吉|凶|凶|吉|吉\",\n" +
            "\t\t\t\"sui\": \"60\",\n" +
            "\t\t\t\"nan\": \"8\",\n" +
            "\t\t\t\"nv\": \"7\"\n" +
            "\t\t}\n" +
            "\t]\n" +
            "}";


//    static void setStatusBarColor(Activity activity, int statusColor) {
//        Window window = activity.getWindow();
//        //设置Window为全透明
//        window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
//
//        ViewGroup mContentView = (ViewGroup) window.findViewById(Window.ID_ANDROID_CONTENT);
//        //获取父布局
//        View mContentChild = mContentView.getChildAt(0);
//        //获取状态栏高度
//        int statusBarHeight = getStatusBarHeight(activity);
//
//        //如果已经存在假状态栏则移除，防止重复添加
//        removeFakeStatusBarViewIfExist(activity);
//        //添加一个View来作为状态栏的填充
//        addFakeStatusBarView(activity, statusColor, statusBarHeight);
//        //设置子控件到状态栏的间距
//        addMarginTopToContentChild(mContentChild, statusBarHeight);
//        //不预留系统栏位置
//        if (mContentChild != null) {
//            ViewCompat.setFitsSystemWindows(mContentChild, false);
//        }
//    }
//    public static void removeFakeStatusBarViewIfExist(Activity activity) {
//        Window window = activity.getWindow();
//        ViewGroup mDecorView = (ViewGroup) window.getDecorView();
//
//        View fakeView = mDecorView.findViewWithTag(TAG_FAKE_STATUS_BAR_VIEW);
//        if (fakeView != null) {
//            mDecorView.removeView(fakeView);
//        }
//    }
//    public static View addFakeStatusBarView(Activity activity, int statusBarColor, int statusBarHeight) {
//        Window window = activity.getWindow();
//        ViewGroup mDecorView = (ViewGroup) window.getDecorView();
//
//        View mStatusBarView = new View(activity);
//        FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, statusBarHeight);
//        layoutParams.gravity = Gravity.TOP;
//        mStatusBarView.setLayoutParams(layoutParams);
//        mStatusBarView.setBackgroundColor(statusBarColor);
//        mStatusBarView.setTag(TAG_FAKE_STATUS_BAR_VIEW);
//
//        mDecorView.addView(mStatusBarView);
//        return mStatusBarView;
//    }
//    public static void addMarginTopToContentChild(View mContentChild, int statusBarHeight) {
//        if (mContentChild == null) {
//            return;
//        }
//        if (!TAG_MARGIN_ADDED.equals(mContentChild.getTag())) {
//            FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) mContentChild.getLayoutParams();
//            lp.topMargin += statusBarHeight;
//            mContentChild.setLayoutParams(lp);
//            mContentChild.setTag(TAG_MARGIN_ADDED);
//        }
//    }
//    static void setContentTopPadding(Activity activity, int padding) {
//        ViewGroup mContentView = (ViewGroup) activity.getWindow().findViewById(Window.ID_ANDROID_CONTENT);
//        mContentView.setPadding(0, padding, 0, 0);
//    }

    public static PopupWindow popupWindows;

    public static void closepopup() {
        if (popupWindows != null)
            popupWindows.dismiss();
    }
    /**
     * 加载动画
     *
     * @param context 上下文对象
     * @param v       传入一个随意空间
     * @param settext 表达的一个文字
     */
    public static void windows(final Activity context, View v, String settext) {
        View popupwindowviews = LayoutInflater.from(context).inflate(
                R.layout.popupwindow_loding, null);
        TextView textview = popupwindowviews.findViewById(R.id.loding_text);
        textview.setText(settext);
        popupWindows = new PopupWindow(popupwindowviews, ViewGroup.LayoutParams.WRAP_CONTENT,
                ViewGroup.LayoutParams.WRAP_CONTENT, true);
        popupWindows.setAnimationStyle(R.style.popwin_anim_style);
        popupWindows.setTouchable(false);
        popupWindows.setOnDismissListener(new PopupWindow.OnDismissListener() {
            @Override
            public void onDismiss() {
                // TODO Auto-generated method stub
                WindowManager.LayoutParams lp = context.getWindow().getAttributes();
                lp.alpha = 1f;
                context.getWindow().setAttributes(lp);
            }
        });
        popupWindows.setFocusable(false);
        popupWindows.setOutsideTouchable(false);
        WindowManager.LayoutParams lp = context.getWindow().getAttributes();
        lp.alpha = 0.4f;
        context.getWindow().setAttributes(lp);
        popupWindows.showAtLocation(v, Gravity.CENTER, 0, 0);
    }
}
